package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;

class zajd {
   private String a;
   private zaul b;
   private zauk c;
   private Worksheet d;
   private Workbook e;
   private com.aspose.cells.a.f.zi f;
   private zoz g;
   private String h;
   private String i;
   private String j;
   private static final com.aspose.cells.b.c.a.za k = new com.aspose.cells.b.c.a.za(new String[]{"formula", "cacheIndex", "outline", "fieldPosition", "field", "count", "name", "numFmtId", "databaseField", "base", "par", "groupBy", "autoEnd", "autoStart", "startDate", "endDate", "startNum", "endNum", "groupInterval", "containsBlank", "containsDate", "containsMixedTypes", "containsNumber", "containsInteger", "containsNonDate", "containsString", "containsSemiMixedTypes", "minDate", "maxDate", "longText", "id", "createdVersion", "refreshOnLoad", "saveData", "recordCount", "missingItemsLimit", "i1", "i2", "i3", "i4", "ref", "sheet"});

   public zauk a() {
      return this.c;
   }

   zajd(zoz var1, String var2, String var3, com.aspose.cells.a.f.zi var4, String var5) {
      this.g = var1;
      this.a = var2;
      this.b = var1.a.getWorksheets().U();
      this.e = var1.a;
      this.i = var3;
      this.f = var4;
      this.j = var5;
   }

   void a(zcfw var1) throws Exception {
      this.c = new zauk(this.b);
      this.c.r = zase.C(this.i);
      this.c.u = this.b.getCount();
      this.c.F = this.j;
      this.b.b(this.c);
      if (this.c.r > this.b.c) {
         this.b.c = this.c.r;
      }

      this.n(var1);
      if (!var1.n()) {
         if ("pivotCacheDefinition".equals(var1.p()) && var1.r() == 1) {
            this.h(var1);
         }

         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if ("cacheSource".equals(var1.p()) && var1.r() == 1) {
                  this.i(var1);
               } else if ("cacheFields".equals(var1.p()) && var1.r() == 1) {
                  this.f(var1);
               } else if ("calculatedItems".equals(var1.p()) && var1.r() == 1) {
                  this.d(var1);
               } else if ("extLst".equals(var1.p()) && var1.r() == 1) {
                  this.b(var1);
               } else {
                  var1.a();
               }
            }

            return;
         }
      }
   }

   void b(zcfw var1) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if (var1.r() != 1) {
                  var1.a();
               } else if ("ext".equals(var1.p()) && var1.r() == 1) {
                  this.c(var1);
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   void c(zcfw var1) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if (var1.r() != 1) {
                  var1.a();
               } else if ("pivotCacheDefinition".equals(var1.p()) && var1.r() == 1) {
                  if (var1.a("pivotCacheId") != null) {
                     this.c.a = zase.C(var1.a("pivotCacheId"));
                  }

                  var1.a();
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   void b() throws Exception {
      HashMap var1 = this.g.c();
      if (var1 != null && this.h != null) {
         if (!var1.containsKey(this.h)) {
            throw new CellsException(6, "pivotCacheRecord rid " + this.h + " not found in pivotCache rels file");
         } else {
            zqe var2 = (zqe)var1.get(this.h);
            zaje var3 = new zaje(this.g, this.c, var2.e, this.f);
            String var4 = "xl/pivotCache/" + com.aspose.cells.b.a.d.zk.b(var2.e);
            zcfw var5 = zasr.a(this.f, var4, true);
            if (var5 != null) {
               var3.a(var5);
            }
         }
      }
   }

   private void d(zcfw var1) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if ("calculatedItem".equals(var1.p()) && var1.r() == 1) {
                  this.e(var1);
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   private void e(zcfw var1) throws Exception {
      zaus var2 = new zaus(this.c);
      if (this.c.v == null) {
         this.c.v = new zaur();
      }

      this.c.v.a(var2);
      if (var1.m()) {
         while(var1.l()) {
            switch(k.a(var1.p())) {
            case 0:
               String var3 = var1.s();
               if (!var3.startsWith("=")) {
                  var3 = "=" + var3;
               }

               var2.b(var3);
            }
         }

         var1.k();
      }

      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if ("pivotArea".equals(var1.p()) && var1.r() == 1) {
                  this.a(var1, var2);
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   private void a(zcfw var1, zaus var2) throws Exception {
      zbro var3 = new zbro();
      var2.f = var3;
      if (var1.m()) {
         while(true) {
            if (!var1.l()) {
               var1.k();
               break;
            }

            switch(k.a(var1.p())) {
            case 1:
               if ("1".equals(var1.s())) {
                  var3.e(true);
               }
               break;
            case 2:
               if ("1".equals(var1.s())) {
                  var3.f(true);
               } else {
                  var3.f(false);
               }
               break;
            case 3:
               var3.a = (byte)zase.E(var1.s());
            }
         }
      }

      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if (var1.r() != 1) {
                  var1.a();
               } else if ("references".equals(var1.p()) && var1.r() == 1) {
                  this.a(var1, var3, var2);
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   private void a(zcfw var1, zbro var2, zaus var3) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if ("reference".equals(var1.p()) && var1.r() == 1) {
                  this.b(var1, var2, var3);
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   private void b(zcfw var1, zbro var2, zaus var3) throws Exception {
      zbqw var4 = new zbqw();
      com.aspose.cells.b.a.a.ze.a(var2.e, (Object)var4);
      if (var1.m()) {
         while(true) {
            if (!var1.l()) {
               var1.k();
               break;
            }

            switch(k.a(var1.p())) {
            case 4:
               var4.b((int)zase.E(var1.s()));
               var3.a(zase.E(var1.s()));
               var4.b = var3.a() | 1024;
               var4.a((int)1);
            }
         }
      }

      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if (var1.r() != 1) {
                  var1.a();
               } else if ("x".equals(var1.p()) && var1.r() == 1) {
                  String var5 = var1.a("v");
                  if (var4.c == null) {
                     var4.c = new ArrayList();
                  }

                  com.aspose.cells.b.a.a.ze.a(var4.c, (Object)zase.C(var5));
                  var1.a();
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   private void f(zcfw var1) throws Exception {
      if (var1.m()) {
         while(true) {
            if (!var1.l()) {
               var1.k();
               break;
            }

            switch(k.a(var1.p())) {
            case 5:
               this.c.i = 0;
            }
         }
      }

      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if ("cacheField".equals(var1.p()) && var1.r() == 1) {
                  this.g(var1);
               } else {
                  var1.a();
               }
            }

            var1.h();
            this.c.n = new zaun(this.c);
            return;
         }
      }
   }

   private void g(zcfw var1) throws Exception {
      zbqs var2 = new zbqs(this.c);
      ++this.c.i;
      var2.e(true);
      if (this.c.p == null) {
         this.c.p = new ArrayList();
      }

      com.aspose.cells.b.a.a.ze.a(this.c.p, (Object)var2);
      if (var1.m()) {
         while(var1.l()) {
            switch(k.a(var1.p())) {
            case 0:
               var2.g(true);
               var2.d = "=" + var1.s();
               var2.f = new ArrayList();

               try {
                  WorksheetCollection var3 = this.b.b;
                  var3.a((Object)this.c);
                  var2.e = var3.x().a(-1, var2.d, 0, 0, 0, 64, false, false, false);
                  var3.a((Object)null);
               } catch (Exception var4) {
                  ;
               }
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            default:
               break;
            case 6:
               var2.a = var1.s();
               if (var2.c() && !var2.m()) {
                  var2.c = new ArrayList();
               }
               break;
            case 7:
               var2.q = zase.C(var1.s());
               break;
            case 8:
               if ("0".equals(var1.s())) {
                  var2.o = true;
                  --this.c.i;
               }
            }
         }

         var1.k();
      }

      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if ("sharedItems".equals(var1.p()) && var1.r() == 1) {
                  this.b(var1, var2);
               } else if ("fieldGroup".equals(var1.p()) && var1.r() == 1) {
                  this.a(var1, var2);
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   private void a(zcfw var1, zbqs var2) throws Exception {
      SxRng var3 = new SxRng(var2);
      var2.j = var3;
      var2.h(true);
      if (var1.m()) {
         while(true) {
            if (!var1.l()) {
               var1.k();
               break;
            }

            switch(k.a(var1.p())) {
            case 9:
               var3.k = zase.C(var1.s());
               break;
            case 10:
               var3.l = zase.C(var1.s());
            }
         }
      }

      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if (var1.r() != 1) {
                  var1.a();
               } else if ("rangePr".equals(var1.p()) && var1.r() == 1) {
                  this.b(var1, var3);
                  var1.a();
               } else if ("discretePr".equals(var1.p()) && var1.r() == 1) {
                  this.a(var1, var3);
                  var1.a();
               } else if ("groupItems".equals(var1.p()) && var1.r() == 1) {
                  this.c(var1, var3);
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   private void a(zcfw var1, SxRng var2) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         var2.n = new ArrayList();
         var1.d();

         while(var1.r() != 4) {
            var1.j();
            if (var1.r() != 1) {
               var1.a();
            } else if ("x".equals(var1.p()) && var1.r() == 1) {
               com.aspose.cells.b.a.a.ze.a(var2.n, (Object)var1.a("v"));
               var1.a();
            }
         }

      }
   }

   private void b(zcfw var1, SxRng var2) throws Exception {
      if (var1.m()) {
         while(true) {
            if (!var1.l()) {
               var1.k();
               break;
            }

            switch(k.a(var1.p())) {
            case 11:
               var2.c = zase.aN(var1.s());
               break;
            case 12:
               if ("1".equals(var1.s())) {
                  var2.b = true;
               } else {
                  var2.b = false;
               }
               break;
            case 13:
               if ("1".equals(var1.s())) {
                  var2.a = true;
               } else {
                  var2.a = false;
               }
               break;
            case 14:
               var2.f = DateTime.a(var1.s());
               break;
            case 15:
               var2.g = DateTime.a(var1.s());
               break;
            case 16:
               var2.h = zase.B(var1.s());
               break;
            case 17:
               var2.i = zase.B(var1.s());
               break;
            case 18:
               var2.j = zase.B(var1.s());
            }
         }
      }

   }

   private void c(zcfw var1, SxRng var2) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         var2.d = new ArrayList();
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if (var1.r() != 1) {
                  var1.a();
               } else {
                  zbmb var3;
                  if ("s".equals(var1.p()) && var1.r() == 1) {
                     var3 = new zbmb();
                     var3.a = var1.a("v");
                     if ("1".equals(var1.a("f"))) {
                        var3.b = true;
                     }

                     if ("1".equals(var1.a("u"))) {
                        var3.c = true;
                     }

                     com.aspose.cells.b.a.a.ze.a(var2.d, (Object)var3);
                     var1.a();
                  } else if ("n".equals(var1.p()) && var1.r() == 1) {
                     var3 = new zbmb();
                     var3.a = zase.B(var1.a("v"));
                     if ("1".equals(var1.a("f"))) {
                        var3.b = true;
                     }

                     if ("1".equals(var1.a("u"))) {
                        var3.c = true;
                     }

                     com.aspose.cells.b.a.a.ze.a(var2.d, (Object)var3);
                     var1.a();
                  } else if ("d".equals(var1.p()) && var1.r() == 1) {
                     var3 = new zbmb();
                     var3.a = com.aspose.cells.b.a.ze.h(var1.a("v"));
                     if ("1".equals(var1.a("f"))) {
                        var3.b = true;
                     }

                     if ("1".equals(var1.a("u"))) {
                        var3.c = true;
                     }

                     com.aspose.cells.b.a.a.ze.a(var2.d, (Object)var3);
                     var1.a();
                  } else if ("b".equals(var1.p()) && var1.r() == 1) {
                     var3 = new zbmb();
                     var3.a = "1".equals(var1.a("v"));
                     if ("1".equals(var1.a("f"))) {
                        var3.b = true;
                     }

                     if ("1".equals(var1.a("u"))) {
                        var3.c = true;
                     }

                     com.aspose.cells.b.a.a.ze.a(var2.d, (Object)var3);
                     var1.a();
                  } else if ("m".equals(var1.p()) && var1.r() == 1) {
                     var3 = new zbmb();
                     var3.a = null;
                     if ("1".equals(var1.a("f"))) {
                        var3.b = true;
                     }

                     if ("1".equals(var1.a("u"))) {
                        var3.c = true;
                     }

                     com.aspose.cells.b.a.a.ze.a(var2.d, (Object)var3);
                     var1.a();
                  } else if ("e".equals(var1.p()) && var1.r() == 1) {
                     var3 = new zbmb();
                     var3.a = var1.a("v");
                     if ("1".equals(var1.a("f"))) {
                        var3.b = true;
                     }

                     if ("1".equals(var1.a("u"))) {
                        var3.c = true;
                     }

                     com.aspose.cells.b.a.a.ze.a(var2.d, (Object)var3);
                     var1.a();
                  } else {
                     var1.a();
                  }
               }
            }

            var1.h();
            return;
         }
      }
   }

   private void b(zcfw var1, zbqs var2) throws Exception {
      if (var1.m()) {
         while(true) {
            if (!var1.l()) {
               var1.k();
               break;
            }

            switch(k.a(var1.p())) {
            case 19:
               if ("1".equals(var1.s())) {
                  var2.j(true);
               } else {
                  var2.j(false);
               }
               break;
            case 20:
               if ("1".equals(var1.s())) {
                  var2.f(true);
               } else {
                  var2.f(false);
               }
               break;
            case 21:
               if ("1".equals(var1.s()) && var2.j()) {
                  var2.b(true);
               }
               break;
            case 22:
               if ("1".equals(var1.s())) {
                  var2.b(true);
               } else {
                  var2.b(false);
               }
               break;
            case 23:
               if ("1".equals(var1.s())) {
                  var2.c(true);
               } else {
                  var2.c(false);
               }
            case 24:
            case 26:
            default:
               break;
            case 25:
               if ("1".equals(var1.s())) {
                  var2.e(true);
               } else {
                  var2.e(false);
               }
               break;
            case 27:
               var2.k = var1.s();
               break;
            case 28:
               var2.l = var1.s();
               break;
            case 29:
               if ("1".equals(var1.s())) {
                  var2.p = true;
               } else {
                  var2.p = false;
               }
            }
         }
      }

      if (var1.n()) {
         var2.a(false);
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if (var1.r() != 1) {
                  var1.a();
               } else {
                  var2.a(true);
                  zbmb var3;
                  String var4;
                  if ("s".equals(var1.p()) && var1.r() == 1) {
                     var3 = new zbmb();
                     var4 = var1.a("v");
                     var3.a = zase.b(var4);
                     if ("1".equals(var1.a("f"))) {
                        var3.b = true;
                     }

                     if ("1".equals(var1.a("u"))) {
                        var3.c = true;
                     }

                     com.aspose.cells.b.a.a.ze.a(var2.c, (Object)var3);
                     var1.a();
                  } else if ("n".equals(var1.p()) && var1.r() == 1) {
                     var3 = new zbmb();
                     var4 = var1.a("v");
                     var3.a = zase.B(var4);
                     if ("1".equals(var1.a("f"))) {
                        var3.b = true;
                     }

                     if ("1".equals(var1.a("u"))) {
                        var3.c = true;
                     }

                     if (var3.c) {
                        var3.d = var4;
                     }

                     com.aspose.cells.b.a.a.ze.a(var2.c, (Object)var3);
                     var1.a();
                  } else if ("d".equals(var1.p()) && var1.r() == 1) {
                     var3 = new zbmb();
                     var3.a = com.aspose.cells.b.a.ze.h(var1.a("v"));
                     if ("1".equals(var1.a("f"))) {
                        var3.b = true;
                     }

                     if ("1".equals(var1.a("u"))) {
                        var3.c = true;
                     }

                     com.aspose.cells.b.a.a.ze.a(var2.c, (Object)var3);
                     var1.a();
                  } else if ("b".equals(var1.p()) && var1.r() == 1) {
                     var3 = new zbmb();
                     var3.a = "1".equals(var1.a("v"));
                     if ("1".equals(var1.a("f"))) {
                        var3.b = true;
                     }

                     if ("1".equals(var1.a("u"))) {
                        var3.c = true;
                     }

                     com.aspose.cells.b.a.a.ze.a(var2.c, (Object)var3);
                     var1.a();
                  } else if ("m".equals(var1.p()) && var1.r() == 1) {
                     var3 = new zbmb();
                     var3.a = null;
                     if ("1".equals(var1.a("f"))) {
                        var3.b = true;
                     }

                     if ("1".equals(var1.a("u"))) {
                        var3.c = true;
                     }

                     com.aspose.cells.b.a.a.ze.a(var2.c, (Object)var3);
                     var1.a();
                  } else if ("e".equals(var1.p()) && var1.r() == 1) {
                     var3 = new zbmb();
                     var3.a = var1.a("v");
                     if ("1".equals(var1.a("f"))) {
                        var3.b = true;
                     }

                     if ("1".equals(var1.a("u"))) {
                        var3.c = true;
                     }

                     com.aspose.cells.b.a.a.ze.a(var2.c, (Object)var3);
                     var1.a();
                  } else {
                     var1.a();
                  }
               }
            }

            var1.h();
            return;
         }
      }
   }

   private void h(zcfw var1) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         this.c.a(true, 1);
         if (var1.m()) {
            while(var1.l()) {
               switch(k.a(var1.p())) {
               case 30:
                  this.h = var1.s();
                  break;
               case 31:
                  this.c.x = var1.s();
                  break;
               case 32:
                  if ("1".equals(var1.s())) {
                     this.c.a(true);
                  }
                  break;
               case 33:
                  if ("0".equals(var1.s())) {
                     this.c.a(false, 1);
                  }
                  break;
               case 34:
                  this.c.m = zase.C(var1.s());
                  break;
               case 35:
                  this.c.B = zase.C(var1.s());
               }
            }

            var1.k();
         }

      }
   }

   private void i(zcfw var1) throws Exception {
      String var2 = var1.a("type");
      this.c.d = zase.ac(var2);
      if (this.c.d != 1 && this.c.d != 4) {
         zqc var3 = new zqc(this.c);
         var3.d = this.a;
         var3.c = this.i;
         this.c.E = var3;
         var1.a();
      } else if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if ("worksheetSource".equals(var1.p()) && var1.r() == 1) {
                  this.m(var1);
               } else if ("consolidation".equals(var1.p()) && var1.r() == 1) {
                  this.j(var1);
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   private void j(zcfw var1) throws Exception {
      if ("0".equals(var1.a("autoPage"))) {
         this.c.h = false;
      }

      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if ("pages".equals(var1.p()) && var1.r() == 1) {
                  this.l(var1);
               } else if ("rangeSets".equals(var1.p()) && var1.r() == 1) {
                  this.k(var1);
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   private void k(zcfw var1) throws Exception {
      ArrayList var2 = new ArrayList();
      int var3 = 0;
      int var4 = zase.C(var1.a("count"));
      this.c.g = new int[var4][];
      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if ("rangeSet".equals(var1.p()) && var1.r() == 1) {
                  this.a(var1, var2, var3);
                  ++var3;
               } else {
                  var1.a();
               }
            }

            var1.h();
            this.c.n = new zaun(this.c);
            if (var2.size() != 0) {
               this.c.e = new zqr[var2.size()];

               for(int var5 = 0; var5 < var2.size(); ++var5) {
                  this.c.e[var5] = (zqr)var2.get(var5);
               }
            }

            return;
         }
      }
   }

   private void l(zcfw var1) throws Exception {
      int var2 = 0;
      int var3 = zase.C(var1.a("count"));
      if (!this.c.h) {
         this.c.f = new String[var3][];
      } else {
         this.c.f = new String[1][];
      }

      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if ("page".equals(var1.p()) && var1.r() == 1) {
                  this.a(var1, var2);
                  ++var2;
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   private void a(zcfw var1, int var2) throws Exception {
      int var3 = 0;
      int var4 = zase.C(var1.a("count"));
      String[] var5 = this.c.f[var2] = new String[var4];
      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if ("pageItem".equals(var1.p()) && var1.r() == 1) {
                  var5[var3] = var1.a("name");
                  ++var3;
                  var1.a();
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   private void a(zcfw var1, ArrayList var2, int var3) throws Exception {
      zqr var4 = null;
      String var5 = null;
      String var6 = null;
      String var7 = null;
      if (var1.m()) {
         if (var1.a("i4") != null) {
            this.c.g[var3] = new int[4];
         } else if (var1.a("i3") != null) {
            this.c.g[var3] = new int[3];
         } else if (var1.a("i2") != null) {
            this.c.g[var3] = new int[2];
         } else {
            this.c.g[var3] = new int[1];
         }

         while(var1.l()) {
            switch(k.a(var1.p())) {
            case 6:
               var6 = var1.s();
               break;
            case 36:
               this.c.g[var3][0] = zase.C(var1.s());
               break;
            case 37:
               this.c.g[var3][1] = zase.C(var1.s());
               break;
            case 38:
               this.c.g[var3][2] = zase.C(var1.s());
               break;
            case 39:
               this.c.g[var3][3] = zase.C(var1.s());
               break;
            case 40:
               var5 = var1.s();
               break;
            case 41:
               var7 = var1.s();
            }
         }

         var1.k();
      }

      var1.a();
      if (var6 == null && var7 != null) {
         this.d = this.e.getWorksheets().get(var7);
         if (this.d == null) {
            zqc var16 = new zqc(this.c);
            var16.d = this.a;
            var16.c = this.i;
            this.c.E = var16;
            return;
         }

         var4 = new zqr(this.c, this.d, var5);
         Range var15 = this.d.getCells().createRange(var5);
         var4.b = var15;
         var4.c = var15;
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var4);
         this.c.j = this.c.i = var15.getColumnCount();
         this.c.k = var15.getRowCount() - 1;
         this.c.t = this.d;
         this.c.p = new ArrayList(this.c.i);
      } else {
         boolean var8 = var7 == null;
         if (!var8) {
            this.d = this.e.getWorksheets().get(var7);
            if (this.d == null) {
               zqc var17 = new zqc(this.c);
               var17.d = this.a;
               var17.c = this.i;
               this.c.E = var17;
               return;
            }
         }

         boolean var9 = false;
         int var10 = var8 ? -1 : this.d.getIndex();
         Name var11 = this.e.getWorksheets().getNames().a(var6, var10);
         Range var12 = null;
         if (var11 == null) {
            var9 = true;
            var11 = this.e.getWorksheets().getNames().get(var6);
         }

         zqc var13;
         if (var11 == null) {
            var13 = new zqc(this.c);
            var13.d = this.a;
            var13.c = this.i;
            this.c.E = var13;
            return;
         }

         if (var9) {
            this.d = var11.getRange().getWorksheet();
         }

         var12 = var11.s();
         if (var12 == null) {
            var13 = new zqc(this.c);
            var13.d = this.a;
            var13.c = this.i;
            this.c.E = var13;
            return;
         }

         if (!var8) {
            if (zakq.b(this.d.getName())) {
               (new StringBuilder()).append("'").append(this.d.getName()).append("'!").append(var12.b()).toString();
            } else {
               (new StringBuilder()).append(this.d.getName()).append("!").append(var12.b()).toString();
            }
         }

         zqr var14 = new zqr(this.c, this.d, var6);
         var14.b = var12;
         var14.c = var12;
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var14);
         this.c.j = this.c.i = var12.getColumnCount();
         this.c.k = var12.getRowCount() - 1;
         this.c.t = this.d;
         this.c.p = new ArrayList(this.c.i);
      }

   }

   private void m(zcfw var1) throws Exception {
      ArrayList var2 = new ArrayList();
      zqr var3 = null;
      String var4 = null;
      String var5 = null;
      String var6 = null;
      String var7 = null;
      if (var1.m()) {
         while(true) {
            if (!var1.l()) {
               var1.k();
               break;
            }

            if ("ref".equals(var1.p())) {
               var4 = var1.s();
            } else if ("name".equals(var1.p())) {
               var5 = var1.s();
               if (var5.startsWith("=")) {
                  var5 = var5.substring(1);
               }
            } else if ("sheet".equals(var1.p())) {
               var6 = var1.s();
            } else if ("id".equals(var1.p())) {
               var7 = var1.s();
            }
         }
      }

      var1.a();
      if (var5 == null && var6 != null) {
         this.d = this.e.getWorksheets().get(var6);
         if (var7 != null && var7.length() > 0) {
            HashMap var19 = this.g.c();
            if (var19 == null) {
               return;
            }

            if (!var19.containsKey(var7)) {
               throw new CellsException(6, "pivotCacheRecord rid " + this.h + " not found in pivotCache rels file");
            }

            zqe var21 = (zqe)var19.get(var7);
            var3 = new zqr(this.c, (Worksheet)null, var4);
            com.aspose.cells.b.a.a.ze.a(var2, (Object)var3);
            String var22 = var21.e;
            String var23 = "";
            if (var22.startsWith("/")) {
               var22 = var22.substring(1);
            }

            int var25;
            if (var22.indexOf("/") != -1 && var22.endsWith(".xls")) {
               var25 = var22.lastIndexOf("/");
               var23 = var22.substring(0, 0 + var25 + 1) + "[" + var22.substring(var25 + 1) + "]";
            }

            var3.d = com.aspose.cells.b.a.zv.a(var23, "%20", " ") + var6;
            this.c.p = new ArrayList(this.c.i);
            if (var2.size() != 0) {
               this.c.e = new zqr[var2.size()];

               for(var25 = 0; var25 < var2.size(); ++var25) {
                  this.c.e[var25] = (zqr)var2.get(var25);
               }
            }

            zqc var26 = new zqc(this.c);
            var26.d = this.a;
            var26.c = this.i;
            this.c.E = var26;
            return;
         }

         if (this.d == null) {
            zqc var18 = new zqc(this.c);
            var18.d = this.a;
            var18.c = this.i;
            this.c.E = var18;
            return;
         }

         if (var4 != null) {
            var3 = new zqr(this.c, this.d, var4);
            Range var16 = this.d.getCells().createRange(var4);
            var3.b = var16;
            var3.c = var16;
            var3.f = var7;
            com.aspose.cells.b.a.a.ze.a(var2, (Object)var3);
            this.c.j = this.c.i = var16.getColumnCount();
            this.c.k = var16.getRowCount() - 1;
            this.c.t = this.d;
            this.c.p = new ArrayList(this.c.i);
         }
      } else {
         boolean var8 = var6 == null;
         if (!var8) {
            this.d = this.e.getWorksheets().get(var6);
            if (this.d == null) {
               zqc var20 = new zqc(this.c);
               var20.d = this.a;
               var20.c = this.i;
               this.c.E = var20;
               return;
            }
         }

         boolean var9 = false;
         int var10 = var8 ? -1 : this.d.getIndex();
         Name var11 = this.e.getWorksheets().getNames().a(var5, var10);
         Range var12 = null;
         if (var11 == null) {
            var9 = true;
            var11 = this.e.getWorksheets().getNames().get(var5);
         }

         zqc var13;
         if (var11 != null) {
            if (var9) {
               this.d = var11.getRange().getWorksheet();
            }

            var12 = var11.s();
            if (var12 == null) {
               var13 = new zqc(this.c);
               var13.d = this.a;
               var13.c = this.i;
               this.c.E = var13;
               return;
            }
         } else if ("_xlnm.Print_Area".equals(var5) && this.d.getPageSetup().a(false)) {
            try {
               Range[] var24 = this.d.getPageSetup().b(false);
               if (var24 != null) {
                  var12 = var24[0];
               }
            } catch (Exception var15) {
               ;
            }
         } else {
            var12 = zbsg.a(this.e.getWorksheets(), var10, 0, 0, var5, true);
            if (var12 == null) {
               var13 = new zqc(this.c);
               var13.d = this.a;
               var13.c = this.i;
               this.c.E = var13;
               return;
            }

            var12.a(var5);
            this.d = var12.getWorksheet();
         }

         var12.a(var5);
         if (!var8) {
            if (zakq.b(this.d.getName())) {
               (new StringBuilder()).append("'").append(this.d.getName()).append("'!").append(var12.b()).toString();
            } else {
               (new StringBuilder()).append(this.d.getName()).append("!").append(var12.b()).toString();
            }
         }

         zqr var14 = new zqr(this.c, this.d, var5);
         if (var6 == null) {
            var14.e = true;
         }

         var14.b = var12;
         var14.c = var12;
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var14);
         this.c.j = this.c.i = var12.getColumnCount();
         this.c.k = var12.getRowCount() - 1;
         this.c.t = this.d;
         this.c.p = new ArrayList(this.c.i);
      }

      if (var2.size() != 0) {
         this.c.e = new zqr[var2.size()];

         for(int var17 = 0; var17 < var2.size(); ++var17) {
            this.c.e[var17] = (zqr)var2.get(var17);
         }
      }

   }

   private void n(zcfw var1) throws Exception {
      var1.j();
      if (var1.r() != 1 || !"pivotCacheDefinition".equals(var1.p())) {
         throw new IllegalStateException("pivotCacheDefinition root element eror");
      }
   }
}
